package com.hui.demo.shiro;

import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.SimpleHash;

public class TestEnCryption {
    public static void main (String[] args) {
        String password = "123";
        String salt = new SecureRandomNumberGenerator().nextBytes().toString();
        int times = 2;
        String algorithmName = "md5";
        String encodePassword = new SimpleHash(algorithmName, password, salt, times).toString();
        System.out.printf("原始密码是 %s，盐是%s，运算次数%d,密文%s", password, salt, times, encodePassword);
    }
}
